package com.comando.model;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import org.hibernate.annotations.GenericGenerator;

/**
 * UserRoleT entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "user_role_t", catalog = "qunar", uniqueConstraints = @UniqueConstraint(columnNames = "USER_ID"))
public class UserRoleT implements java.io.Serializable {

	// Fields

	private Integer userRoleId;
	private UserT userT;
	private String role;

	// Constructors

	/** default constructor */
	public UserRoleT() {
	}

	/** full constructor */
	public UserRoleT(UserT userT, String role) {
		this.userT = userT;
		this.role = role;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "increment")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "USER_ROLE_ID", unique = true, nullable = false)
	public Integer getUserRoleId() {
		return this.userRoleId;
	}

	public void setUserRoleId(Integer userRoleId) {
		this.userRoleId = userRoleId;
	}

	@OneToOne(cascade = CascadeType.ALL)
	@JoinColumn(name = "USER_ID")
	public UserT getUserT() {
		return this.userT;
	}

	public void setUserT(UserT userT) {
		this.userT = userT;
	}

	@Column(name = "ROLE", length = 250)
	public String getRole() {
		return this.role;
	}

	public void setRole(String role) {
		this.role = role;
	}

}